package org.jz.gae.redbook.spb.server.controller;


import org.jz.gae.redbook.spb.server.cache.FamilyCashe;
import org.jz.gae.redbook.spb.shared.FamilyEntityView;

import com.google.appengine.api.datastore.Entity;

public class FamilyCasheGoogle extends AbstractCasheGoogle<FamilyEntityView> implements FamilyCashe
{
	private static FamilyCashe instance;
	
	public synchronized static FamilyCashe getInstance()
	{
		if (instance == null)
		{
			instance = new FamilyCasheGoogle();
		}
		return instance;
	}
	
	@Override
	public synchronized FamilyEntityView getEntityView(String _EntityKey)
	{
		return getEntityViewInternal(_EntityKey);
	}

	@Override
	protected FamilyEntityView produceViewFormEntity(Entity _Entity)
	{
		FamilyEntityView result = new FamilyEntityView();
        FamilyUtils.reflectEntityToView(_Entity, result);
		return result;
	}

}
